package main

import "fmt"

func main() {
	// struct value
	m:=make(map[int]X)
	m[1]=X{1}
	m[2]=X{2}

	// todo cannot assign to struct field m[1].V in map
	//m[1].V=100
	m[1]=X{100}
	fmt.Println(m[1])

	// *struct value
	m1:=make(map[int]*X)
	m1[1]=&X{1}
	m1[2]=&X{2}

	m1[1].V=100
	fmt.Println(*m1[1])


}

type X struct {
	V int
}